# -*- coding: utf-8 -*-
# @Time : 2022-06-24 9:07
# @Author : Z
# @Function : 移动端-菜品沽清

from Keywords.inter_keys import Inter

inter = Inter()

# 设置系统地址
inter.set_url('')

# # 登陆
# inter.post_json('/auth/systemV1/username-login',
#                 '{"password":"Q473E3h3U20XtB8nqJN2FFREwY7FCgZW7cDNvxwgNjFmlptfsc49ryYW1KYS+HnynqXNp2ppvImhlnRhFOQa9Ekf94EITNqnvGxin6dNqBf4Scl5WiU1z6VZGTfYquETtCOey7L03gEz2+5CdAa1sB7IOjL3fLmUBxtdYzET43Y=","name":"15678300490","channelId":"11"}')
# # 断言登陆成功
# # inter.assert_equals('code', '0000')
# # # 提取token
# # inter.save_json("$.data.accessToken", "newtoken")
# # # 添加authorization到请求头
# inter.add_header('authorization', '{newtoken}')

# 获取菜单菜品信息
# storeId(门店id)非空，Long
inter.post_json('/maintain/storage/chinese-food/product', '{"storeId":"1409687251966676993"}')

# 获取菜品做法信息
# storeId(门店id)非空，Long
inter.post_json('/maintain/storage/chinese-food/special-cook', '{"storeId":"1409687251966676993"}')

# 菜品规格库存沽清
# storeId      productId   specId   storageQuantity  specName    productName   非空
# 店铺id(str)  菜品id(str） 规格(str)  库存数量(int)   规格名称(str)  菜品名称(str)
inter.post_json('/maintain/storage/chinese-food/product-spec/storage/save',
                '{"productStorageId": "1539511433367048194","storeId": "1409687251966676993","productId": "1407599473878224897","specId": "1","storageQuantity": 15,"specName": "系统默认规格","productName": "糖葫芦（原味）"}')

# 菜品规格库存沽清修改，接口地址可能给错了
# productStorageId  storeId      productId   specId   storageQuantity  specName    productName   非空
# 菜品库存ID(str)	   店铺id(str)  菜品id(str） 规格(str)  库存数量(int)   规格名称(str)  菜品名称(str)
inter.post_json('/maintain/storage/chinese-food/product-spec/storage/save',
                '{"productStorageId": "1539511433367048194","storeId": "1409687251966676993","productId": "1407599473878224897","specId": "1","storageQuantity": 15,"specName": "系统默认规格","productName": "糖葫芦（原味）"}')

# 菜品规格库存取消沽清
# productStorageId  菜品库存ID(str)	 非空
inter.post_json('/maintain/storage/chinese-food/product-spec/storage/delete',
                '{"productStorageId": "1539511433367048194"}')

# 清空菜品沽清
# storeId 店铺id(str) 非空
inter.post_json('/maintain/storage/chinese-food/product-spec/storage/clean', '{"storeId":"1409687251966676993"}')

# 取消做法沽清
# specialCookStorageId  做法库存ID(str) 非空
inter.post_json('/maintain/storage/chinese-food/special-cook/storage/delete,',
                '{"specialCookStorageId": "1536602333419352065"}')

# 清空做法沽清
# storeId 店铺id(str) 非空
inter.post_json('/maintain/storage/chinese-food/special-cook/storage/clean','{"storeId":"1409687251966676993"}')

